Namespaces
Variants
Views
Actions

std::shared_lock

From cppreference.com
Defined in header <mutex>
template< class Mutex >
class shared_lock;
(since C++14)

The class shared_lock is a general-purpose shared mutex ownership wrapper allowing deferred locking, timed locking and transfer of lock ownership,

The shared_lock class is movable, but not copyable -- it meets the requirements of MoveConstructible and MoveAssignable but not of CopyConstructible or CopyAssignable.

Contents

[edit] Template parameters

Mutex - the type of the shared mutex to lock. The type must meet the SharedMutex requirements

[edit] Member types

Type Definition
mutex_type Mutex

[edit] Member functions

Template:cpp/thread/shared lock/dsc constructorTemplate:cpp/thread/shared lock/dsc destructorTemplate:cpp/thread/shared lock/dsc operator=Template:cpp/thread/shared lock/dsc lockTemplate:cpp/thread/shared lock/dsc try lockTemplate:cpp/thread/shared lock/dsc try lock forTemplate:cpp/thread/shared lock/dsc try lock untilTemplate:cpp/thread/shared lock/dsc unlockTemplate:cpp/thread/shared lock/dsc swapTemplate:cpp/thread/shared lock/dsc releaseTemplate:cpp/thread/shared lock/dsc mutexTemplate:cpp/thread/shared lock/dsc owns lockTemplate:cpp/thread/shared lock/dsc operator bool
Shared locking
Modifiers
Observers

[edit] Non-member functions

Template:cpp/thread/shared lock/dsc swap2